@skeleton-bg: var(--skeleton-color);

.li-waterfall {
  --skeleton-color: #f2f2f2;
  --show-delay: 1s;

  --span: 5px;

  position: relative;

  .placeholder {
    width: 100%;
    position: absolute;
  }

  .item {
    position: absolute;
    width: calc(50% - var(--span));
    opacity: 0;
    transition: all 0.1s;
  }

  .skeletons {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;

    .skeleton {
      width: calc(50% - var(--span));
      background: white;
      border-radius: 20rpx;
      box-shadow: 10rpx 10rpx 20rpx rgba(22, 14, 14, 0.03);
      overflow: hidden;
      position: relative;
      margin-bottom: 10px;
      opacity: 0;
      animation: show var(--show-delay) ease-in forwards;

      &::before {
        content: '';
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        background: linear-gradient(
            100deg,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 60%
          )
          transparent;
        background-size: 200% 100%;
        background-position-x: 180%;
        animation: 2s loading ease-in-out 10;
      }

      .skeleton-image {
        width: 100%;
        height: 180px;
        background: @skeleton-bg;
      }

      .skeleton-text {
        width: calc(100% - 40rpx);
        height: 55px;
        display: flex;
        flex-flow: column;
        justify-content: space-between;
        align-items: stretch;
        padding: 10px;

        .text-line {
          height: 30rpx;
          border-radius: 15rpx;
          background: @skeleton-bg;

          &:nth-child(1) {
            width: 50%;
          }
          &:nth-child(2) {
            width: 70%;
          }
        }
      }
    }
  }
}

@keyframes show {
  to {
    opacity: 1;
  }
}

@keyframes loading {
  to {
    background-position-x: -20%;
  }
}
